package cn.jy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        //自动扫描bean 必须和启动类在同级包下 或者是同级包的子包下
        //在开发中大量使用了 约定大于配置的思想，摆脱了各种手动配置
        ConfigurableApplicationContext app = SpringApplication.run(Application.class, args);
        Application bean = app.getBean(Application.class);
        System.out.println(bean);
        User user = app.getBean(User.class);
        System.out.println(user);
    }
}
